import { Prop, Schema, SchemaFactory } from '@nestjs/mongoose';
import { HydratedDocument } from 'mongoose';

export type CpuCodeDocumentType = HydratedDocument<CPU_CODE>;
export type CpuSeriesDocumentType = HydratedDocument<CPU_Series>;
export type CpuCodeInfoDocumentType = HydratedDocument<CPU_CODE_INFO>;


@Schema()
export class CPU_CODE {
  @Prop({ required: true })
  manufacturers: string; //厂商

  @Prop({ required: true })
  series: string; //系列

  @Prop({ required: true })
  code_name: string; //芯片代号
}

@Schema()
export class CPU_Series {
  @Prop({ required: true })
  manufacturers: string; //厂商

  @Prop({ required: true })
  series: string; //系列
}

@Schema()
export class CPU_CODE_INFO {
  @Prop({ required: true })
  manufacturers: string; //厂商

  @Prop({ required: true })
  series: string; //系列

  @Prop({ required: true })
  code_name: string; //芯片代号

  @Prop({ required: true })
  cores: string; //核心数量

  @Prop({ required: true })
  threads: string; //线程数量

  @Prop({ required: true })
  clock_speed: string; //核心频率

  @Prop({ required: true })
  socket_type: string; //加速频率

  @Prop({ required: true })
  L2: string; //二级缓存

  @Prop({ required: true })
  L3: string; //三级缓存

  @Prop({ required: true })
  img_url_arr: string[]; //图片地址

  @Prop({ required: true })
  pro_tech: string; //制程工艺

  @Prop({ required: true })
  price: number; //价格

  @Prop({ required: true })
  score: number; // 性能评分
}





export const CpuCodeSchema = SchemaFactory.createForClass(CPU_CODE);

export const CpuSeriesSchema = SchemaFactory.createForClass(CPU_Series);

export const CpuCodeInfoSchema = SchemaFactory.createForClass(CPU_CODE_INFO);